package com.zmn.oms.third.jingdong;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 类描述：
 *
 * @author LiangHailong
 * @date 2019/09/03 15:29
 */
@Component
public final class JingdongConsts {
    public static final String CHANNEL_NAME = "京东服务+";
    public static final int CHANNEL_ID = 10777;

    public static boolean POWER_ON; // 京东服务接入总开关（用于测试环境中关闭京东接入）
    public static int SCALP_ID; // 刷单ID，取消缘由中，存在有此ID的条目时，标识该单为刷单  2021-07-12 16:29:00 by lhl

    public static String APPKEY;
    public static String SECRET;

    public static String VENDOR_CODE;   // 服务商编码，用于京东API调用中的请求参数
    public static String REQUEST_TOKEN; // 请求token，用于京东API调用中的请求参数
    public static String OPERATOR_PHONE = "4000238888"; // 操作人电话，用于同步工单完成/取消接口中的请求参数

    public static final String MASTER_PHONE = "4000806601"; // 师傅电话，用于同步接单师傅信息接口

    public static String API_URL;
    public static String TOKEN_URL;
    public static String AUTHORIZE_CODE_URL;
    public static String REDIRECT_URL;


    @Value("${jingdong.service-plus.power-on:false}")
    public void setPowerOn(boolean powerOn) {
        POWER_ON = powerOn;
    }
    @Value("${jingdong.service-plus.appkey:null}")
    public void setAppkey(String appkey) {
        APPKEY = appkey;
    }
    @Value("${jingdong.service-plus.secret:null}")
    public void setSecret(String secret) {
        SECRET = secret;
    }
    @Value("${jingdong.service-plus.vendor-code:null}")
    public void setVendorCode(String vendorCode) {
        VENDOR_CODE = vendorCode;
    }
    @Value("${jingdong.service-plus.request-token:null}")
    public void setRequestToken(String requestToken) {
        REQUEST_TOKEN = requestToken;
    }
    @Value("${jingdong.service-plus.url.get-token:null}")
    public void setTokenUrl(String tokenUrl) {
        TOKEN_URL = tokenUrl;
    }
    @Value("${jingdong.service-plus.url.authorize-code:null}")
    public void setAuthorizeCodeUrl(String authorizeCodeUrl) {
        AUTHORIZE_CODE_URL = authorizeCodeUrl;
    }
    @Value("${jingdong.service-plus.url.zmn-callbck:null}")
    public void setRedirectUrl(String redirectUrl) {
        REDIRECT_URL = redirectUrl;
    }
    @Value("${jingdong.service-plus.url.api-invok:null}")
    public void setApiUrl(String apiUrl) {
        API_URL = apiUrl;
    }

    /**
     * 私有构造器，禁止外部实例化
     */
    private JingdongConsts() {}
}
